package com.zjp.mg.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Field;

import java.math.BigDecimal;
import java.util.Date;

@Data
//@Document
public class Order {
    //@MongoId(value = FieldType.INT64) 如果不指定注解类型 不需要增加此配置
    @Id
    @Field("_id")
    private String orderId;
    private Long userId;

    private Integer orderType;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date applyTime;

    private BigDecimal orderPrice;


    // 方案
    public Order(String id, BigDecimal orderPrice) {
        this.orderId = id;
        this.orderPrice = orderPrice;
    }

    public Order() {

    }
}
